using System;
using System.IO;

namespace SharpWind.Resources.Creators
{
	public class ScriptFromFileCreator : IResourceCreator<Script>
	{
		private string path = string.Empty;
		
		public ScriptFromFileCreator( string path )
		{
			if( path != null && path != string.Empty && File.Exists( path ) )
			{
				this.path = path;
			} // if (path)
			else
			{
				throw new Exception();
			} // else
		}
	
		public Script Create()
		{
			Script script = new Script();
			script.ScriptFile = this.path;
			
			return script;
		}
	}
}
